package jtk.project4.fleet.field;

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TextField;

public class EditTireHistory1Field extends GroupControl{
	private CalendarControl dateField;
	private TextField meterField;
	private TextField treadField;
	private TextField pressureField;
	
	public EditTireHistory1Field(String bindID){
		setTitle("header.TireHistoryField");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		meterField = new TextField ("Meter", 25);
		meterField.setRequired(true);
		
		treadField = new TextField ("Tread", 25);
		treadField.setRequired(true);
		
		pressureField = new TextField ("Pressure", 25);
		pressureField.setRequired(true);
			
		dateField = new CalendarControl("Date", 25);
		dateField.setPreferredSize(new Dimension(166,20));
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("label.date")		.addField(dateField)
		.addRow()
		.addLabel("label.meter")	.addField(meterField)
		.addRow()
		.addLabel("label.tread")	.addField(treadField)
		.addRow()
		.addLabel("label.pressure")	.addField(pressureField)
		.addRow()
		;
	}
}